#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2018, Intel Corporation
#
#
# libpmempool_bttdev/TEST7 -- test for checking btt
#

. ../unittest/unittest.sh

require_test_type medium

require_fs_type any

setup

POOL=$DIR/file.pool
LOG=out${UNITTEST_NUM}.log
rm -f $LOG && touch $LOG
EXE=../libpmempool_api/libpmempool_test

expect_normal_exit $BTTCREATE $POOL >> $LOG

$PMEMSPOIL -v $POOL "bttdevice.arena(0).btt_info.sig=BADSIGNATURE"\
		"bttdevice.arena(0).btt_info.external_lbasize=10"\
		"bttdevice.arena(0).btt_info.major=0x0" >> $LOG

expect_normal_exit $EXE$EXESUFFIX -r 1 -t btt $POOL >> $LOG

check_file $POOL

check

pass
